package com.example.champtionthree.view;

import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Parcelable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.champtionthree.R;
import com.example.champtionthree.adapter.FatherAdapter;
import com.example.champtionthree.bean.ExamInfo;
import com.example.champtionthree.model.TestModel;
import com.example.common.ICommonModel;
import com.example.common.base.BaseMvpFragment;

import java.util.ArrayList;


public class ExamFragment extends BaseMvpFragment {


    private static final String ARG_PARAM1 = "param1";

    public String mParam1;
    public ArrayList<ExamInfo.SmallItemInfo> value;
    public RecyclerView recyclerView;


    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        recyclerView=getView().findViewById(R.id.recyclerview);
        recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
        recyclerView.setAdapter(new FatherAdapter(value,getContext()));
    }

    @Override
    public int setLayoutId() {
        return R.layout.fragment_first;
    }

    @Override
    public void setUpView() {

    }

    @Override
    public void setUpData() {

    }

    @Override
    public ICommonModel setModel() {
        return null;
    }

    public static ExamFragment newInstance(ArrayList<? extends Parcelable> value) {
        ExamFragment fragment = new ExamFragment();
        Bundle args = new Bundle();
        args.putParcelableArrayList(ARG_PARAM1,value);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            value = getArguments().getParcelableArrayList(ARG_PARAM1);

        }
    }



    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
    }


    @Override
    public void onSuccess(int whichApi, int loadType, Object[] d) {

    }

    @Override
    public void onFailed(Throwable pThrowable) {

    }
}